import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        scanner.close();
        long[] dp = new long[n + 1];
        dp[0] = 1;
        final long MOD = 109;
        for (int i = 1; i <= n; i++) {
            for (int j = 0; j < i; j++) {
                dp[i] = (dp[i] + dp[j] + (i - j)) % MOD;
            }
        }

        System.out.println(dp[n]);
    }
}
